﻿namespace CodeContrib
{
	public class RandomCompanyName : IRandom<string>
	{
		private static readonly string[] _companyNames;
		private readonly RandomItem<string> _randomCompanyNames;

		static RandomCompanyName()
		{
			_companyNames = new[]
				                {
					                "Apple", "Asda", "Aviva", "BP", "British Airways", "BT", "GlaxoSmithKline", "Dell", "Ferrari", "Honda", "HSBC", "Intel", "Kingfisher", "Marks and Spencer", "Microsoft", "Next", "Philips", "Rolls Royce", "Sage", "Sony", "Tesco", "Toshiba", "Toyota", "Vodafone"
				                };
		}

		public RandomCompanyName()
		{
			_randomCompanyNames = new RandomItem<string>(_companyNames);
		}

		public string Next()
		{
			return _randomCompanyNames.Next();
		}
	}
}